package com.str.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import com.str.vo.GenInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author: ZhangWu, Anything is possible!
 * @CreateTime: 2023/04/16 11:16
 * @Description: 导入Excel基因数据请求dto
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ExcelTarget(value = "importKitInfoDto")
public class ImportKitInfoDto implements IExcelDataModel, IExcelModel {
    /**
     * 行号
     */
    private int rowNum;
    /**
     * 错误消息
     */
    private String errorMsg;

    /**
     * 试剂盒名称
     */
    @Excel(name = "试剂盒",fixedIndex = 0,mergeVertical =true)
    private String kitName;
    /**
     * 组分数：0，未知，1：1人份，2：2人份，3：3人份
     */
    @Excel(name = "组分数",fixedIndex = 1,mergeVertical =true)
    private Integer comNumber;
    /**
     * 采样类型，1：血斑、2：唾液斑、3：汗斑、4：精斑、5：毛发、6：烟蒂、7：骨骼、8：牙齿，9：脱落上皮细胞，10：其它
     */
    @Excel(name = "采用类型",fixedIndex = 2,replace ={"血斑_1","唾液斑_2","汗斑_3","精斑_4","毛发_5","烟蒂_6","骨骼_7","牙齿_8","脱落上皮细胞_9","其它_10"},mergeVertical =true)
    @Min(value = 1,message = "采用类型输入错误" )
    @Max(value = 10,message = "采用类型输入错误" )
    private int samplingType;
    /**
     * 来源（存放链接）
     */
    @Excel(name = "来源",fixedIndex = 3,mergeVertical =true)
    private String source;

    /**
     * 基因座信息集合
     */
    @ExcelCollection(name = "基因座信息" )
    private List<ImportLocusInfoDto> list;



    @Override
    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum+1;
    }

    public Integer getRowNum() {
        return rowNum;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    @Override
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

}
